package eu.telecom_bretagne.RECRUT.data.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.Set;


/**
 * The persistent class for the candidature database table.
 * 
 */
@Entity
@NamedQuery(name="Candidature.findAll", query="SELECT c FROM Candidature c")
public class Candidature implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CANDIDATURE_ID_GENERATOR", sequenceName="CANDIDATURE_ID_SEQ", allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CANDIDATURE_ID_GENERATOR")
	private Integer id;

	@Column(name="adresse_email")
	private String adresseEmail;

	@Column(name="adresse_postale")
	private String adressePostale;

	private String cv;

	@Temporal(TemporalType.DATE)
	@Column(name="date_depot")
	private Date dateDepot;

	@Temporal(TemporalType.DATE)
	@Column(name="date_naissance")
	private Date dateNaissance;

	@Column(name="nom_candidature")
	private String nomCandidature;

	@Column(name="prenom_candidature")
	private String prenomCandidature;

	//bi-directional many-to-one association to DossierCandidature
	@OneToMany(mappedBy="candidature")
	private Set<DossierCandidature> dossierCandidatures;

	public Candidature() {
	}

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getAdresseEmail() {
		return this.adresseEmail;
	}

	public void setAdresseEmail(String adresseEmail) {
		this.adresseEmail = adresseEmail;
	}

	public String getAdressePostale() {
		return this.adressePostale;
	}

	public void setAdressePostale(String adressePostale) {
		this.adressePostale = adressePostale;
	}

	public String getCv() {
		return this.cv;
	}

	public void setCv(String cv) {
		this.cv = cv;
	}

	public Date getDateDepot() {
		return this.dateDepot;
	}

	public void setDateDepot(Date dateDepot) {
		this.dateDepot = dateDepot;
	}

	public Date getDateNaissance() {
		return this.dateNaissance;
	}

	public void setDateNaissance(Date dateNaissance) {
		this.dateNaissance = dateNaissance;
	}

	public String getNomCandidature() {
		return this.nomCandidature;
	}

	public void setNomCandidature(String nomCandidature) {
		this.nomCandidature = nomCandidature;
	}

	public String getPrenomCandidature() {
		return this.prenomCandidature;
	}

	public void setPrenomCandidature(String prenomCandidature) {
		this.prenomCandidature = prenomCandidature;
	}

	public Set<DossierCandidature> getDossierCandidatures() {
		return this.dossierCandidatures;
	}

	public void setDossierCandidatures(Set<DossierCandidature> dossierCandidatures) {
		this.dossierCandidatures = dossierCandidatures;
	}

	public DossierCandidature addDossierCandidature(DossierCandidature dossierCandidature) {
		getDossierCandidatures().add(dossierCandidature);
		dossierCandidature.setCandidature(this);

		return dossierCandidature;
	}

	public DossierCandidature removeDossierCandidature(DossierCandidature dossierCandidature) {
		getDossierCandidatures().remove(dossierCandidature);
		dossierCandidature.setCandidature(null);

		return dossierCandidature;
	}

}